---
title: Disabling Keys
description: "Enable or disable a key. Disabled keys will not validate."
---

This feature is useful for disabling a key temporarily. While disabled the key will act as an invalid key. 

Example:
Suppose you have a customer that has not paid their bill. You may not want to delete the key and wait for the account balance to be current. The key can be disabled temporarily, preventing access until it is enabled.

Unkey allows you to disable a key on an individual basis. 

### Example

Let's disable a key temperarily blocking access with that key. 

```bash
curl --request POST \
  --url https://api.unkey.com/v2/keys.updateKey \
  --header 'Authorization: Bearer <ROOT_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "keyId": "<KEY_ID>",
    "enabled": false
  }'
```

Now, when you verify the updated key it will show as invalid.

```bash
curl --request POST \
  --url https://api.unkey.com/v2/keys.verifyKey \
  --header 'Content-Type: application/json' \
  --data '{
    "key": "<KEY>"
  }'
```


```json
{
  "meta": {
    "requestId": "req_abc123def456"
  },
  "data": {
    "valid": false,
    "keyId": "<KEY_ID>",
    "enabled": false,
    "code": "DISABLED"
  }
}
```

<Note>
  The returned `enabled` value can be changed with the updateKey endpoint to re-enable the key. 
</Note>
